3.528 \(\int \cos ^3(c+d x) (a+b \tan (c+d x))^2 \, dx\)

Optimal. Leaf size=90 \[ -\frac{\left (2 a^2+b^2\right ) \sin ^3(c+d x)}{6 d}+\frac{\left (2 a^2+b^2\right ) \sin (c+d x)}{2 d}-\frac{a b \cos ^3(c+d x)}{6 d}-\frac{b \cos ^3(c+d x) (a+b \tan (c+d x))}{2 d} \]

[Out]

-(a*b*Cos[c + d*x]^3)/(6*d) + ((2*a^2 + b^2)*Sin[c + d*x])/(2*d) - ((2*a^2 + b^2)*Sin[c + d*x]^3)/(6*d) - (b*C
os[c + d*x]^3*(a + b*Tan[c + d*x]))/(2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0945082, antiderivative size = 90, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3508, 3486, 2633} \[ -\frac{\left (2 a^2+b^2\right ) \sin ^3(c+d x)}{6 d}+\frac{\left (2 a^2+b^2\right ) \sin (c+d x)}{2 d}-\frac{a b \cos ^3(c+d x)}{6 d}-\frac{b \cos ^3(c+d x) (a+b \tan (c+d x))}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^3*(a + b*Tan[c + d*x])^2,x]

[Out]

-(a*b*Cos[c + d*x]^3)/(6*d) + ((2*a^2 + b^2)*Sin[c + d*x])/(2*d) - ((2*a^2 + b^2)*Sin[c + d*x]^3)/(6*d) - (b*C
os[c + d*x]^3*(a + b*Tan[c + d*x]))/(2*d)

Rule 3508

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[(b*(d*Se
c[e + f*x])^m*(a + b*Tan[e + f*x]))/(f*(m + 1)), x] + Dist[1/(m + 1), Int[(d*Sec[e + f*x])^m*(a^2*(m + 1) - b^
2 + a*b*(m + 2)*Tan[e + f*x]), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && NeQ[a^2 + b^2, 0] && NeQ[m, -1]

Rule 3486

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*(d*Sec[
e + f*x])^m)/(f*m), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 2633

Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[Expand[(1 - x^2)^((n - 1)/2), x], x], x
, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[(n - 1)/2, 0]

Rubi steps

\begin{align*} \int \cos ^3(c+d x) (a+b \tan (c+d x))^2 \, dx &=-\frac{b \cos ^3(c+d x) (a+b \tan (c+d x))}{2 d}-\frac{1}{2} \int \cos ^3(c+d x) \left (-2 a^2-b^2-a b \tan (c+d x)\right ) \, dx\\ &=-\frac{a b \cos ^3(c+d x)}{6 d}-\frac{b \cos ^3(c+d x) (a+b \tan (c+d x))}{2 d}-\frac{1}{2} \left (-2 a^2-b^2\right ) \int \cos ^3(c+d x) \, dx\\ &=-\frac{a b \cos ^3(c+d x)}{6 d}-\frac{b \cos ^3(c+d x) (a+b \tan (c+d x))}{2 d}-\frac{\left (2 a^2+b^2\right ) \operatorname{Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{2 d}\\ &=-\frac{a b \cos ^3(c+d x)}{6 d}+\frac{\left (2 a^2+b^2\right ) \sin (c+d x)}{2 d}-\frac{\left (2 a^2+b^2\right ) \sin ^3(c+d x)}{6 d}-\frac{b \cos ^3(c+d x) (a+b \tan (c+d x))}{2 d}\\ \end{align*}

Mathematica [A]  time = 0.456233, size = 64, normalized size = 0.71 \[ \frac{\sin (c+d x) \left (\left (a^2-b^2\right ) \cos (2 (c+d x))+5 a^2+b^2\right )-3 a b \cos (c+d x)-a b \cos (3 (c+d x))}{6 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^3*(a + b*Tan[c + d*x])^2,x]

[Out]

(-3*a*b*Cos[c + d*x] - a*b*Cos[3*(c + d*x)] + (5*a^2 + b^2 + (a^2 - b^2)*Cos[2*(c + d*x)])*Sin[c + d*x])/(6*d)

________________________________________________________________________________________

Maple [A]  time = 0.056, size = 52, normalized size = 0.6 \begin{align*}{\frac{1}{d} \left ({\frac{{b}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{3}}-{\frac{2\,ab \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{3}}+{\frac{{a}^{2} \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) }{3}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^3*(a+b*tan(d*x+c))^2,x)

[Out]

1/d*(1/3*b^2*sin(d*x+c)^3-2/3*a*b*cos(d*x+c)^3+1/3*a^2*(2+cos(d*x+c)^2)*sin(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.43123, size = 70, normalized size = 0.78 \begin{align*} -\frac{2 \, a b \cos \left (d x + c\right )^{3} - b^{2} \sin \left (d x + c\right )^{3} +{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a^{2}}{3 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^3*(a+b*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/3*(2*a*b*cos(d*x + c)^3 - b^2*sin(d*x + c)^3 + (sin(d*x + c)^3 - 3*sin(d*x + c))*a^2)/d

________________________________________________________________________________________

Fricas [A]  time = 1.86064, size = 120, normalized size = 1.33 \begin{align*} -\frac{2 \, a b \cos \left (d x + c\right )^{3} -{\left ({\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, a^{2} + b^{2}\right )} \sin \left (d x + c\right )}{3 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^3*(a+b*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/3*(2*a*b*cos(d*x + c)^3 - ((a^2 - b^2)*cos(d*x + c)^2 + 2*a^2 + b^2)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan{\left (c + d x \right )}\right )^{2} \cos ^{3}{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**3*(a+b*tan(d*x+c))**2,x)

[Out]

Integral((a + b*tan(c + d*x))**2*cos(c + d*x)**3, x)

________________________________________________________________________________________

Giac [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: NotImplementedError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^3*(a+b*tan(d*x+c))^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError